﻿using NHibernate.Mapping.Attributes;
using System;

/*
 * 插入的时候以Id 的最大值进行递增插入
 * 即 select max(Id) from IceZeroTest_IncrementMode
 */

namespace IceZero.DataStore.Models
{
    /// <summary>
    /// increment , 用于为int类型生成 唯一标识。只有在没有其他进程往同一张表中插入数据时才能使用。在集群下不要使用。
    /// </summary>
    [Class(Table = "IceZeroTest_IncrementMode")]
    public class IncrementModeModel 
    {
        [Id(0, Name = "Id", TypeType = typeof(int),Length = 11)]
        [Key(1)]
        [Generator(1, Class = "increment")]
        public virtual int Id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Property(Column = "CreateTime", TypeType = typeof(DateTime))]
        public virtual DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 备注
        /// </summary>
        [Property(Column = "Remark", TypeType = typeof(string), Length = 1000)]
        public virtual string Remark { get; set; }
    }
}
